package net.hound.site.image;

import java.util.List;

import net.cl.utils.HtmlUtil;
import net.cl.utils.HttpUtil;
import net.hound.download.Downloader;

public class DefaultHandler {

	protected String url;

	public DefaultHandler(String url) {
		this.url = url;
	}

	public List<String> getImages() {
		String html = HttpUtil.getResponseString(url);
		return HtmlUtil.getImg(html);
	}

	public void downloadAllImages(String target) {
		List<String> list = getImages();
		Downloader dl = new Downloader();
		dl.start(list.toArray(new String[0]), target);
	}

}
